package server;

import java.io.Serializable;
import java.util.ArrayList;

public class Journal implements Serializable{
	
	private String title;
	private ArrayList<String> associated;
	private Patient patient;
	private String division;
	private String text;
	
	public Journal(String title, Patient patient, String division, String text){
		this.title = title;
		this.patient = patient;
		this.division = division;
		this.text = text;
		associated = new ArrayList<String>();
	}
	
	public boolean isAssociated(String a){
		return associated.contains(a);
	}
	
	public void associateWith(String a){
		associated.add(a);
	}
	
	public String toString(){
		String s = "This is a journal for patient " + patient.toString() + "\nDivision: " + division + "\n" + text;
		return s;
	}
	
	public String title(){
		return title;
	}
	
	public String getDivision(){
		return division;
	}
	
	public String getPatientName(){
		return patient.toString();
	}

	public void setText(String text2) {
		text = text2;
	}
}
